<%@ page language="java" contentType="text/html; charset=utf8"
	pageEncoding="utf8"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf8">
	<title><spring:message code="label.addContact" /></title>
</head>
<body>
  
<h2><spring:message code="label.addContact" /></h2>

<c:if test="${!empty contactAttribute}">
	<c:url var="saveUrl" value="editContact?id=$contact.contactId}" />	
</c:if>
<c:if test="${empty contactAttribute}">
	<c:url var="saveUrl" value="add" />	
</c:if>
<form:form modelAttribute="contact" method="POST" action="${saveUrl}" commandName="contact">
             <form:errors path="*" cssClass="error"/>
	<table>
		<tr>
			<td>    		
				<div class="row for_inp">
					<form:label path="contactNickName">
						<spring:message code="label.nickname" />
					</form:label>
					<div class='inp_1'>
						<form:input path="contactNickName" />
					</div>
				</div>
			</td>			
		</tr>

		<tr>
			<td>
				<div class="row for_inp">
					<form:label path="contactFirstName">
						<spring:message code="label.firstname" />
					</form:label>
					<div class='inp_1'>				
						<form:input path="contactFirstName" />
					</div>
				</div>
			</td>
		</tr>
		<tr>
			<td>
				<div class="row for_inp">
					<form:label path="contactLastName">
						<spring:message code="label.lastname" />
					</form:label>
					<div class='inp_1'>	
						<form:input path="contactLastName" />
					</div>
				</div>
			</td>
		</tr>
		<tr>
			<td>
				<div class="row for_inp">
					<form:label path="contactTelephone">
						<spring:message code="label.phone" />
					</form:label>
					<div class='inp_1'>					
						<form:input path="contactTelephone" />
					</div>
				</div>
			</td>
		</tr>		
		<tr>
			<td>
				<div class="row for_inp">
					<form:label path="contactEmail">
						<spring:message code="label.email" />
					</form:label>
					<div class='inp_1'>	
						<form:input path="contactEmail" />
					</div>
				</div>
			</td>
		</tr>
		<tr>
			<td>
				<div class="row for_inp">
					<form:label path="contactWarehouse">
						<spring:message code="label.warehouse" />
					</form:label>
					<div class='inp_1'>	
						<form:input path="contactWarehouse" />
					</div>
				</div>
			</td>
		</tr>
		<tr>
			<td colspan="2"><input  class="but_1"  type="submit"
				value="<spring:message code="label.save"/>" />
			</td>
		</tr>
	</table>
</form:form>

</body>
</html>